﻿using System;
using System.Collections.Generic;
using Assets.Scripts.GtsScripts;
using MoonSharp.Interpreter;
using UnityEngine;

namespace Lua
{
	// Token: 0x020002FB RID: 763
	[MoonSharpUserData]
	public class Senses
	{
		// Token: 0x060012D3 RID: 4819 RVA: 0x00081AFC File Offset: 0x0007FCFC
		[MoonSharpHidden]
		public Senses(EntityBase entity)
		{
			if (entity == null)
			{
				Debug.LogError("Creating Senses with no entity");
			}
			this.entity = entity;
			this.senses = entity.senses;
		}

		// Token: 0x170002E2 RID: 738
		// (get) Token: 0x060012D4 RID: 4820 RVA: 0x00081B2D File Offset: 0x0007FD2D
		// (set) Token: 0x060012D5 RID: 4821 RVA: 0x00081B3A File Offset: 0x0007FD3A
		public float baseVisibilityDistance
		{
			get
			{
				return this.senses.maxDistace;
			}
			set
			{
				this.senses.maxDistace = value;
			}
		}

		// Token: 0x170002E3 RID: 739
		// (get) Token: 0x060012D6 RID: 4822 RVA: 0x00081B48 File Offset: 0x0007FD48
		// (set) Token: 0x060012D7 RID: 4823 RVA: 0x00081B55 File Offset: 0x0007FD55
		public float fieldOfView
		{
			get
			{
				return this.senses.fieldOfView;
			}
			set
			{
				this.senses.fieldOfView = value;
			}
		}

		// Token: 0x060012D8 RID: 4824 RVA: 0x00081B63 File Offset: 0x0007FD63
		public bool CanSee(Entity target)
		{
			return this.entity.senses.CheckVisibility(target.entity);
		}

		// Token: 0x060012D9 RID: 4825 RVA: 0x00081B7C File Offset: 0x0007FD7C
		public List<Entity> GetVisibleEntities(float distance)
		{
			List<EntityBase> visibleEntities = this.entity.senses.GetVisibleEntities(distance);
			List<Entity> list = new List<Entity>();
			foreach (EntityBase entityBase in visibleEntities)
			{
				list.Add(entityBase.GetLuaEntity());
			}
			return list;
		}

		// Token: 0x060012DA RID: 4826 RVA: 0x00081BF4 File Offset: 0x0007FDF4
		public List<Entity> GetEntitiesInRadius(float distance)
		{
			List<EntityBase> entitiesInRadius = this.entity.senses.GetEntitiesInRadius(distance);
			List<Entity> list = new List<Entity>();
			foreach (EntityBase entityBase in entitiesInRadius)
			{
				list.Add(entityBase.GetLuaEntity());
			}
			return list;
		}

		// Token: 0x060012DB RID: 4827 RVA: 0x00081C6C File Offset: 0x0007FE6C
		public List<Entity> GetVisibleMicros(float distance)
		{
			List<EntityBase> visibleMicros = this.entity.senses.GetVisibleMicros(distance);
			List<Entity> list = new List<Entity>();
			foreach (EntityBase entityBase in visibleMicros)
			{
				list.Add(entityBase.GetLuaEntity());
			}
			return list;
		}

		// Token: 0x060012DC RID: 4828 RVA: 0x00081CE4 File Offset: 0x0007FEE4
		public List<Entity> GetMicrosInRadius(float radius)
		{
			List<Micro> list = MicroManager.FindMicrosInRadius(this.entity, radius);
			List<Entity> list2 = new List<Entity>();
			foreach (Micro micro in list)
			{
				list2.Add(micro.GetLuaEntity());
			}
			return list2;
		}

		// Token: 0x060012DD RID: 4829 RVA: 0x00081D54 File Offset: 0x0007FF54
		public List<Entity> GetGiantessesInRadius(float radius)
		{
			List<Giantess> list = GiantessManager.FindGiantessesInRadius(this.entity, radius);
			List<Entity> list2 = new List<Entity>();
			foreach (Giantess giantess in list)
			{
				list2.Add(giantess.GetLuaEntity());
			}
			return list2;
		}

		// Token: 0x040016D7 RID: 5847
		private EntityBase entity;

		// Token: 0x040016D8 RID: 5848
		private SenseController senses;
	}
}
